﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace 影片售票系统.Zq
{
    public partial class Denglu : Form
    {
        public Denglu()
        {
            InitializeComponent();
        }

        private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            zhuce from = new zhuce();
            from.Show();
        }

        private void linkLabel2_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            wangji from = new wangji();
            from.Show();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            
            string name = this.textBox2.Text.Trim();
            string mima = this.textBox1.Text.Trim();
            
            string sql = string.Format("select * from YH_1 where name = '{0}' and mima = '{1}'", name, mima);
      
            DataTable table = common.DBHelper.read(sql);
            Class1.name = name;
            Class1.mima = mima;
            if (table.Rows.Count > 0)
            {
                MessageBox.Show("登录成功");
                this.Close();
            }
            else
            {
                MessageBox.Show("您的账号或者密码错误..");
            }
            //判断用户是否登录
          
            string sql1 = string.Format("update YH_1 set zhuangtai=1 where name='{0}'",name);
            int rs = common.DBHelper.write(sql1);
            string sql2 = "update T_ZT set zhuangtai=1";
            int rs1 = common.DBHelper.write(sql2);
           
        }

        private void Denglu_Load(object sender, EventArgs e)
        {
            
            label4.BackColor = Color.Transparent;
            label3.BackColor = Color.Transparent;
            label2.BackColor = Color.Transparent;
            linkLabel1.BackColor = Color.Transparent;
            linkLabel2.BackColor = Color.Transparent;

            
            textBox2.ForeColor = Color.CornflowerBlue;
           


        }

        private void textBox2_Enter(object sender, EventArgs e)
        {
           
            textBox2.ForeColor = Color.CornflowerBlue;

          

        }

        private void label4_Click(object sender, EventArgs e)
        {

        }

        private void textBox2_Leave(object sender, EventArgs e)
        {
         
        }

 
        }

    }


